package com.sie.demo.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


import java.io.Serializable;
import java.sql.Timestamp;

//@Data：作用于类上，是以下注解的集合：@ToString @EqualsAndHashCode @Getter @Setter @RequiredArgsConstructor
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("Users")
public class Users implements Serializable {
    private static final long serialVersionUID = 30L;
//mabatis-plus:数据库的字段命名方式为使用下划线连接，对应的实体类应该是驼峰命名方式
    private String userName;
    private String password;
    private String name;
    private int status;
    private int sex;
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp createTime;
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp updateTime;
    private String email;
    private String note;
    @TableId("user_id")
    private long userId;
    private String phoneNumber;
    @TableLogic
    @TableField("IS_DELETE")
    private int isDelete;

    public Users(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }
}
